package com.lg.patter.behavior.template;

/**
 * @author by Mr. Li 2020/6/16 13:15
 */
public abstract class AbstractCourse {

    public final void createCourse() {
        //1、发布预习资料
        postPreResoucse();

        //2、制作课件
        createPPT();

        //3、直播授课
        liveVideo();

        //4、上传课后资料
        postResource();

        //5、布置作业
        postHomework();

        if (needCheckHomework()) {
            checkHomework();
        }
    }

    protected abstract void checkHomework();

    /**
     * 钩子方法
     *
     * @return
     */
    protected boolean needCheckHomework() {
        return false;
    }

    protected void postHomework() {
        System.out.println("布置作业");
    }

    protected void postResource(){
        System.out.println("上传课后资料");
    }

    protected void liveVideo(){
        System.out.println("直播授课");
    }

    protected void createPPT(){
        System.out.println("制作课件");
    }

    protected void postPreResoucse(){
        System.out.println("发布预习资料");
    }


}
